#pragma once

#include <QWidget>
#include <QPainter>
#include <QTimer>
#include <QMap>

class LoadingWidgetPrivate;
class LoadingWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoadingWidget(bool autostart = false, const QSize &size = QSize(), const QRect &geometry = QRect(), QWidget *parent = nullptr);
    ~LoadingWidget();

    void SetDotCount(int dots);
    void SetDotColor(const QColor &color);
    void SetDotDiameter(float min, float max);
    void SetInterval(int interval);

    void start();
    void stop();

protected:
    virtual void paintEvent(QPaintEvent *event) override;
    virtual void resizeEvent(QResizeEvent *event) override;

private slots:
    void On_Refresh();

private:

private:
    LoadingWidgetPrivate * const d_ptr;
    Q_DECLARE_PRIVATE(LoadingWidget);
};
